<?php
if( $_GET['r'] == '' ) {
    header ( 'Location: ' . basename(__FILE__) . '?r=1' );
} else {
    echo 'Relocated';
}